package org.nf.shopping.service.Impl;

import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.nf.shopping.entity.DisPatChe;
import org.nf.shopping.mapper.DisPatCheMapper;
import org.nf.shopping.service.DisPatCheService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author czl
 * @Date 2024-12-03
 */
@Service
@RequiredArgsConstructor
public class DisPatCheServiceImpl implements DisPatCheService {

    private final DisPatCheMapper disPatCheMapper;

    @Override
    public PageInfo<DisPatChe> listDisPatChe(Integer pageSize, Integer pageNum, String name) {
        List<DisPatChe> list = disPatCheMapper.listDisPatch(pageSize,pageNum,name);
        PageInfo<DisPatChe> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public void updateDisPatChe(DisPatChe disPatChe) {
        disPatCheMapper.updateDisPatChe(disPatChe);
    }

    @Override
    public void deloneDisPatChe(Integer id) {
        disPatCheMapper.deloneDisPatChe(id);
    }

    @Override
    public void addDisPatChe(DisPatChe disPatChe) {
        disPatCheMapper.addDisPatChe(disPatChe);
    }

    @Override
    public List<DisPatChe> getDisPatCheList() {
        return disPatCheMapper.getDisPatCheList();
    }
}
